#!/bin/bash

echo "==================================="
echo " Starting Blog Project Installation"
echo "==================================="
echo

# Exit immediately if a command exits with a non-zero status.
set -e

echo "[1/2] Installing Backend Dependencies..."
cd backend
npm install
echo "Backend dependencies installed successfully."
echo

echo "[2/2] Installing Frontend Dependencies..."
cd ../frontend
npm install
echo "Frontend dependencies installed successfully."
echo

echo "==================================="
echo "  Installation Complete!"
echo "==================================="
echo
echo "To run the application:"
echo "1. Open a terminal, navigate to the 'backend' directory and run: npm start"
echo "2. Open another terminal, navigate to the 'frontend' directory and run: npm run dev"